package com.baizhi.config;

import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author LZM
 * @version 1.0
 * @Date 2021/12/23
 * @Description 跨域允许
 */
//@Configuration
public class CorsConfig2 implements WebMvcConfigurer {
    @Override
    public void addCorsMappings(CorsRegistry registry) {
        registry.addMapping("/**")
                .allowedOrigins("*")
                .allowCredentials(true)
                .allowedHeaders("Access-Token")
                .allowedMethods("*")
                .maxAge(36000L);
    }
}